<template>
  <div class="home">
    <button @click="logout">登出</button>
    <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
   
  </div>
</template>

<script>
import axios from 'axios'
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'Home',
  components: {
    HelloWorld
  },
  methods: {
    logout(){
      axios.post('http://192.168.4.93:8000/logout').then(res=>{
        if(res.data.code==200){
          this.$router.push('/login')
        }
      })
    }
  },
}
</script>
